Skip to content

Conversation

@alexhagen
Copy link

Previously, when performing range_to on colors with hues that crossed 1.0, the color_scale function used in range_to would go through all intervening hues instead of crossing 1.0. For example, when going from purple with hue 0.94 to red with hue 0.04, range_to returned almost all colors (blue, green, yellow) by ranging from 0.94 downward to 0.04 instead of going from 0.94 to 1.0 and then restarting at 0.0 and going to 0.4. This commit fixes that.

@codecov
Copy link

codecov bot commented Mar 26, 2019

Codecov Report

Merging #48 into master will decrease coverage by 2.32%.
The diff coverage is 88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #48      +/-   ##
==========================================
- Coverage   99.13%   96.81%   -2.33%     
==========================================
  Files           1        1              
  Lines         232      251      +19     
==========================================
+ Hits          230      243      +13     
- Misses          2        8       +6
Impacted Files Coverage Δ
colour.py 96.81% <88%> (-2.33%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11f138e...8a6a0cb. Read the comment docs.

Copy link

@vokimon vokimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn''t be simpler, in case we detect abs(huea-hueb)>0.5, just adding 1 to the lesser hue and modding resulting hues by one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants